/*
 * organizationdao_dboperator.h
 *
 *  Created on: 2013-10-23
 *      Author: hadeswang
 */

#ifndef ORGANIZATIONDAO_DBOPERATOR_H_
#define ORGANIZATIONDAO_DBOPERATOR_H_

#include "erp/organization/ddo/organizationfilterddo_organization.h"
#include "erp/organization/ddo/branchddo_organization.h"
#include "c2cent/storage/mysqlstorage.h"
#include "app_platform/cntl_info.h"

namespace erp
{
namespace organization
{
namespace dao
{

class COrganizationDBOperator
{
public:
	COrganizationDBOperator();
	virtual ~COrganizationDBOperator();
public:
	int32_t ModifyBranch(
			const CCntlInfo& rCntlInfo,
			const std::string& strMachineKey,
			const std::string& strSource,
			const uint32_t dwSceneId,
			const erp::organization::ddo::CBranchDdo& oBranch);

	int32_t GetBranch(
			const CCntlInfo& rCntlInfo,
			const std::string& strMachineKey,
			const std::string& strSource,
			const uint32_t dwSceneId,
			const std::set<uint64_t> & setBranchId,
			std::map<uint64_t,erp::organization::ddo::CBranchDdo> & mapBranch);

	int32_t FindBranch(
			const CCntlInfo& rCntlInfo,
			const std::string& strMachineKey,
			const std::string& strSource,
			uint32_t dwSceneId,
			const erp::organization::ddo::COrganizationFilterDdo& oFilter,
			uint32_t& dwTotal,
			std::vector<erp::organization::ddo::CBranchDdo> & vecBranch);
private:
	c2cent::storage::CMySqlStorage m_oStorage;
};

}
}
}

#endif /* ORGANIZATIONDAO_DBOPERATOR_H_ */
